package com.zelin.cas.controller;

import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * ------------------------------
 * 功能：
 * 作者：WF
 * 微信：hbxfwf13590332912
 * 创建时间：2021/11/11-15:24
 * ------------------------------
 */
@Controller
public class UserController {

    @GetMapping({"/hello.html",""})
    public String hello(){
        //1. 得到登录名
        String name = SecurityContextHolder.getContext().getAuthentication().getName();
        System.out.println("name = " + name);
        return "hello";
    }
}
